cmake_minimum_required(VERSION 3.0.2)
project(px4_uwb)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  nlink_parser
  geometry_msgs
  message_generation
  nav_msgs
)

# Generate messages in the 'msg' folder
add_message_files(
  FILES
  Bspline.msg
  DataDisp.msg
  MultiBsplines.msg
)


## Generate added messages and services with any dependencies listed here
generate_messages(
  DEPENDENCIES
  std_msgs
  geometry_msgs
)

catkin_package(
   INCLUDE_DIRS include
#  LIBRARIES swarm_control
 CATKIN_DEPENDS roscpp rospy std_msgs message_runtime nlink_parser
#  DEPENDS system_lib
)

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

add_executable(uwb_node src/uwb.cpp)
add_executable(sub_pose_test  src/sub_pose_test.cpp)
add_executable(sub_traj_test src/sub_traj_test.cpp)
add_executable(sub_pub_traj src/sub_pub_traj.cpp)
add_executable(sub_pub_pro src/sub_pub_pro.cpp)
add_executable(sub_pose_twist src/sub_pose_twist.cpp)
add_executable(pub src/pub.cpp)
add_executable(pub_trigger src/pub_trigger.cpp)
add_executable(sub_trigger src/sub_trigger.cpp)

target_link_libraries(uwb_node ${catkin_LIBRARIES})
target_link_libraries(sub_pose_test ${catkin_LIBRARIES})
target_link_libraries(sub_traj_test ${catkin_LIBRARIES})
target_link_libraries(sub_pub_traj ${catkin_LIBRARIES})
target_link_libraries(sub_pub_pro ${catkin_LIBRARIES})
target_link_libraries(sub_pose_twist ${catkin_LIBRARIES})
target_link_libraries(pub ${catkin_LIBRARIES})
target_link_libraries(pub_trigger ${catkin_LIBRARIES})
target_link_libraries(sub_trigger ${catkin_LIBRARIES})

add_dependencies(sub_pose_test ${PROJECT_NAME}_generate_messages)
add_dependencies(sub_traj_test ${PROJECT_NAME}_generate_messages)
add_dependencies(sub_pub_traj ${PROJECT_NAME}_generate_messages)
add_dependencies(sub_pub_pro ${PROJECT_NAME}_generate_messages)
add_dependencies(sub_pose_twist ${PROJECT_NAME}_generate_messages)
add_dependencies(pub_trigger ${PROJECT_NAME}_generate_messages)
add_dependencies(sub_trigger ${PROJECT_NAME}_generate_messages)

add_dependencies(sub_pose_test nlink_parser_generate_messages)
add_dependencies(sub_traj_test nlink_parser_generate_messages)
add_dependencies(sub_pub_traj nlink_parser_generate_messages)
add_dependencies(sub_pub_pro nlink_parser_generate_messages)
add_dependencies(sub_pose_twist nlink_parser_generate_messages)
add_dependencies(pub_trigger nlink_parser_generate_messages)
add_dependencies(sub_trigger nlink_parser_generate_messages)
add_dependencies(uwb_node nlink_parser_generate_messages)